
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>"/>
<link rel="stylesheet" href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>增加用户信息</title>
</head>
<body>
	<script type="text/javascript">
	$(function(){
		var all_out_layout =function(texttitle){
			$(".add_success_ok").text(texttitle).prop(texttitle);
			$(".all_out_layout").panel("open");
			window.setInterval(function(){
				$(".all_out_layout").panel("close");
			},2000);
		}
		//文本框验证
		$.extend($.fn.validatebox.defaults.rules, {
		    idcard : {// 验证身份证
		        validator : function(value) {
		            return /^\d{15}(\d{2}[A-Za-z0-9])?$/i.test(value);
		        },
		        message : '身份证号码格式不正确'
		    }
		});
		
		
		$(".back").linkbutton({
			onClick:function(){
				$(".emp_message").panel({
					href:"to_staff"
					
				})
			}
		});
		$("#yj-upload-form-button").click(function(){
			$("#yj-upload-form").form({
				success:function(v){
					var src = eval("("+v+")");
					$("#img").attr("src",src.file);
				}
			}).submit();
			
		});
	
		$(".tianjia").linkbutton({
			onClick:function(){
				//名字1
				var empname = $('#empname-yj').textbox("getText");
				//英文名1
				var empengname = $('#empengname-yj').textbox("getText");
				//部门
				var dept = $('#emp-dept-yj').combobox("getValue");
				//性别1
				var sex = $('#emp-sex-yj').combobox("getValue");
				//职务
				var duty = $('#emp-duty-yj').combobox("getValue");
				//照片1
				var img = $("#img").attr("src");
				//身份证1
				var card = $('#emp-card-yj').textbox("getText");
				//用工状态
				var jobs = $('#emp-jobs-yj').combobox("getValue");
				//职称
				var zc = $('#emp-zc-yj').combobox("getValue");
				//生日1
				var date = $('#emp-date-yj').datetimebox("getText");
				//学历
				var edu = $('#emp-edu-yj').combobox("getValue");
				//入职日期1
				var yzdate = $('#emp-yzdate-yj').datetimebox("getText");
				//转正日期1
				var zzdate = $('#emp-zzdate-yj').datetimebox("getText");
				//政治面貌1
				var zhengzhi = $('#emp-zhengzhi-yj').combobox("getValue");
				//民族
				var minzu = $('#emp-minzu-yj').combobox("getValue");
				//婚姻
				var hunyin = $('#emp-hunyin-yj').combobox("getValue");
				//母语
				var muyu = $('#emp-muyu-yj').combobox("getValue");
				//特征项
				var tzx = $('#emp-tzx-yj').combobox("getValue");
				
				alert(img);
				if(dept=="请选择" || sex=="请选择" || duty=="请选择"  || img==""  || jobs=="请选择" || zc=="请选择" || edu=="请选择" 
					|| zhengzhi=="请选择" || hunyin=="请选择" || muyu=="请选择" || tzx=="请选择" ){
					alert("确定填写完了所有信息");
				}else{
					$.getJSON("addStaff_yj",{
						
						"stain_name":empname,
						"stain_identity":card,
						"stain_sex":sex,
						"stain_bir":date,
						"stain_date":yzdate,
						"stain_estimatedate":zzdate,
						"stain_politics":zhengzhi,
						"stain_src":img,
						"deptId":dept,
						"dutyId":duty,
						"jobsId":jobs,
						"zcId":zc,
						"eduId":edu,
						"minzuId":minzu,
						"hunyinId":hunyin,
						"muyuId":muyu,
						"tzx":tzx
						
					},function(v){
						if(v.success){  
							$(".emp_message").panel({
								
								href:"to_staff"
							});
						}else{
							$.messager.alert('错误', '对不起，操作失败，原因：' + v.message);
						}
					});
				}
				
			}
		});
		
		
		
		
		
	});
	</script>

	<div  id="toolbaruser"  >
		<a href="#" class="easyui-linkbutton back" data-options="iconCls:'icon-reload',plain:true,text:'返回',iconAlign:'left'"></a>
	</div>
	<div style="width:1000px;height:800px;margin-top:10px;margin-left:10px;font-size:14px;">
		<div style="font-size:14px;" data-options="toolbar:'#toolbaruser'">基础信息</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:290px;float:left;margin-right:15px;">
			<table cellspacing="10">
				<tbody>
					
					<tr>
						<td align="right" width="100px">员工姓名</td>
						<td><input class="easyui-textbox" id="empname-yj" data-options="required:true"/></td>
					</tr>
					<tr>
						<td align="right">外文名称</td>
						<td><input class="easyui-textbox" id="empengname-yj"data-options="required:true"/></td>
					</tr>
					<tr>
						<td align="right">部门</td>
						<td>
							<input id="emp-dept-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'defideId',textField:'defideName',url:'find_all_dept',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">职务</td>
						<td>
							<input id="emp-duty-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'dutyId',textField:'dutyName',url:'find_all_duty',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">性别</td>
						<td>
							<select id="emp-sex-yj" class="easyui-combobox" data-options="panelHeight:'auto'" style="width:160px;">   
							    <option>男</option>  
							    <option>女</option> 
							</select> 
						</td>
					</tr>
					<tr>
						<td width="100px" align="right">制单人</td>
						<td><input class="easyui-textbox" value="${staff.stainName}"/></td>
					</tr>
					<tr>
						<td></td>
						<td>
							<form id="yj-upload-form" action="upload" method="post" enctype="multipart/form-data">
								<input type="file" name="f" id="fileset">
								<input type="button" value="上传" id="yj-upload-form-button">
							</form>
						</td>
					</tr>			
				</tbody>
			</table>
		</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:290px;float:left;">	
			<table cellspacing="10">
				<tbody>
					<tr> 
						<img src="#" id="img" style="width:300px;height:250px;margin-bottom:10px;margin-left:60px;margin-top:10px;">
					</tr>
					
				</tbody>
			</table>
		</div>
		<div style="font-size:14px;width:200px;">概览</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:400px;float:left;margin-right:15px;">
			<table cellspacing="10">
				<tbody>
					<tr> 
						<td align="right" width="100px">身份证</td>
						<td>
						<input class="easyui-textbox" id="emp-card-yj" data-options="required:true,validType:'idcard'">
						</td>
					</tr>
					<tr>
						<td align="right">用工状态</td>
						<td>
							<input id="emp-jobs-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'jobsId',textField:'jobsName',url:'find_all_jobstatus',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">职称</td>
						<td>
							<input id="emp-zc-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'zcId',textField:'zcName',url:'find_all_professionalTitle',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">生日</td>
						<td><input type= "text" class= "easyui-datetimebox" data-options="editable:false,required:true" id="emp-date-yj" data-options="required:true"/></td>
					</tr>
					<tr>
						<td align="right">最后学历</td>
						<td>
							<input id="emp-edu-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'eduId',textField:'eduName',url:'find_all_edubackground',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">入职日期</td>
						<td><input type= "text" class= "easyui-datetimebox" data-options="editable:false,required:true" id="emp-yzdate-yj"/></td>
					</tr>
					<tr>
						<td align="right">预计转正</td>
						<td><input type= "text" class= "easyui-datetimebox" data-options="editable:false,required:true" id="emp-zzdate-yj"/></td>
					</tr>
					<tr>
						<td align="right">政治面貌</td>
						<td>
							<select id="emp-zhengzhi-yj" class="easyui-combobox" data-options="panelHeight:'auto'" style="width:160px;">   
							    <option>老百姓</option>  
							    <option>党员</option>   
							    <option>团员</option>   
							    <option>少先队员</option>   
							</select> 
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div style="border-top:2px solid #2B91D5;width:400px;height:400px;float:left;">
			<table cellspacing="10">
				<tbody>
					<tr>
						<td align="right" width="100px">国籍</td>
						<td>
							<select id="emp-guoji-yj" class="easyui-combobox" data-options="panelHeight:'auto'" style="width:160px;">   
							    <option>中国</option>  
							    <option>美国</option>   
							    <option>英国</option>   
							    <option>法国</option>   
							</select> 
						</td>
					</tr>
					<tr>
						<td align="right">名族</td>
						<td>
							<input id="emp-minzu-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'natiId',textField:'natiName',url:'find_all_nationality',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">母语</td>
						<td>
							<input id="emp-muyu-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'mothId',textField:'mothName',url:'find_all_motherTongue',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">婚姻状况</td>
						<td>
							<input id="emp-hunyin-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'marId',textField:'marName',url:'find_all_maritalStatus',plain:true,panelHeight:'auto'" value="请选择"/> 
						</td>
					</tr>
					<tr>
						<td align="right">特征项</td>
						<td>
							<input id="emp-tzx-yj" class="easyui-combobox" name="dept"   
   							 data-options="valueField:'charaId',textField:'charaName',url:'find_all_char',plain:true,panelHeight:'auto'" value="请选择"/>  
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div style="width:800px;height:10px;clear:both;"></div>
		<div style="border-top:2px solid #2B91D5;width:800px;height:10px;clear:both;"></div>
		<a class="easyui-linkbutton tianjia" style="margin-left:30px;width:100px;">添加</a>
	</div>
</body>
</html>